package com.bocsoft.dbsp.base.entity.message;

//import com.bocsoft.dbsp.base.entity.message.RespErrorBody;


public class MyJavaRules34 {

    /************************测试Response类****************************/
    public void exampleWithNullCheck(Response response) {
        if (response != null) {
            response.doSomething();  // Compliant
        }
    }

    public void exampleWithNullCheck1(Response response) {
        if (response == null) {
            return;
        } else {
            response.doSomething();  // Compliant
        }
    }

    public void anotherValidExample() {
        Response response = getResponse();
        if (response != null) {
            response.doSomething();  // Compliant
        }
    }

    public void exampleWithoutNullCheck(Response response) {
        response.doSomething();// Noncompliant {{接口返回值使用前应做非空检查。}}
    }

    public void anotherInvalidExample1() {
        Response response = getResponse();
        response.doSomething();// Noncompliant {{接口返回值使用前应做非空检查。}}
    }

    public Response getResponse() {
        return new Response();
    }
    /************************测试Response类结束****************************/


}

class RespErrorBody {}

class MyResponse extends RespErrorBody{}

class BaseRespBody extends RespErrorBody{}

class M54075Resp extends BaseRespBody{}

class Response {}